<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title></title>
		<link href="css/index2.css" rel="stylesheet" />
	</head>
	<body>
	<div class="gray-bg">
		<div class="headTitle">
		<img onclick="goback()" src="./img/leftArrow.jpg" />
		<p>关联合肥通</p>
       </div>
		<ul class="conetnt cardlist cardInfo">
			<li>
		
				<p class="cardContent">
					<span class="cardTitle"></span>
					<span class="cardNum"></span>
					<span class="cardDate">绑卡日期：</span>
				</p>
		
			</li>
		</ul>
        <button class="release" type="button">解除关联</button>
	</div>  
	
	<div class="wrapBomb" style="display: none;">
		<div class="bombContent">
			<span class="spanTitle" style="height: 1.2rem;"></span>
			<p class="pContent"><span class="spanContent1">解除关联后不可为本卡片</span><span class="spanConetnt2">申请电子发票</span></p>
			<button class="cancle">取消</button>
			<button class="sure">确定解除</button>
		</div>
	</div>
<script src="js/jquery.min.js"></script>
<script src="js/oldPublic.js"></script>
<script src="js/code.js"></script>
<script src="js/security.js"></script>
<script>
	var login_name = sessionStorage.getItem('login_name');
	var telphone = sessionStorage.getItem('telphone');
	var idno = sessionStorage.getItem('idno');
	var idtype = sessionStorage.getItem('idtype');
	var name = sessionStorage.getItem('name');
	var orgcode = sessionStorage.getItem('orgcode');
	
	var cardList = window.location.href.split('?')[1].split('=')[1];
	cardList = decodeURI(cardList);
	cardList = JSON.parse(cardList);
	$('.cardTitle').html(changeType(cardList.acct_type));
	$('.cardNum').html(cardList.acct_no);
	$('.cardDate').html('绑卡日期：'+formateDate(cardList.bind_date));
	console.log(cardList);
	$('.release').click(function(){
		$('.wrapBomb').show();
			
	})
	$('.wrapBomb').find('.cancle').click(function(){
		$('.wrapBomb').hide();
	})
	$('.wrapBomb').find('.sure').click(function(){
		$('.wrapBomb').hide();
		$.ajax({
				type:"post",
				url:sessionStorage.getItem('ipconfig'),
				data:JSON.stringify({data:encryptByDESModeEBC(encryptByDESModeEBC(JSON.stringify({"tag": "9100", 'login_name': login_name, 'telphone': telphone, 'bus_type': '3', 'acct_no': cardList.acct_no, 'acct_type': cardList.acct_type,'name': '0084', 'idtype': '01','idno':'0084','orgcode':orgcode})))}),
				contentType: "application/json;charset=utf-8",
				success:function(data){
					if(data.result=='00'){
						showWarn('解绑成功');
						history.back();
					}else{
						showWarn(data.description);
					}
				}
		})
	})
		function changeType(a){
				var nameText = ''
				if(a=='001'){
					nameText = '住建部'
				}else if(a=='002'){
					nameText = 'Pboc'
				}else if(a=='003'){
					nameText = '交通部'
				}else if(a=='004'){
					nameText = '62BBIN'
				}else if(a=='005'){
					nameText = '虚拟电子卡'
				}else if(a=='006'){
					nameText = '账户系统'
				}
				return nameText
			}
		function formateDate(time){
			var dataTime = new Date(time);
			var year = dataTime.getFullYear();
			var month = dataTime.getMonth()+1;
			month = addZero(month);
			var day = dataTime.getDate();
			day = addZero(day);
			var hour = dataTime.getHours();
			hour = addZero(hour);
			var min = dataTime.getMinutes();
			min = addZero(min);
			console.log(year)
			return year+'年'+month+'月'+day+'日'+' '+hour+':'+min
		}
		
		function addZero(a){
			return a = a<9?'0'+a:a;
		}
</script>

</body>
</html>
